<%@ page import="top.lionkliu.service.impl.NoteServiceImpl" %>
<%@ page import="top.lionkliu.entity.Note" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <title>修改留言</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../static/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css">

    <script src="../static/js/jquery.js"></script>
    <script src="../static/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<%@include file="../common/NavBar.jsp" %>

<%
    String queryString = request.getQueryString();
    String id = queryString.substring(3);

    session.setAttribute("id", id);
    NoteServiceImpl noteService = new NoteServiceImpl();
    Note note = noteService.selectById(Integer.parseInt(id));
%>
<div class="container" style="margin: 0 auto;">
    <h1>修改留言信息</h1>
    <form action="<%=request.getContextPath()%>/note/edit" method="post">
        标题：<input type="text" name="title" value="<%=note.getTitle()%>" class="form-control col-4"/><br>
        作者：<input type="text" name="author" value="<%=note.getAuthor()%>" class="form-control col-4"/><br>
        内容：<input type="text" name="content" value="<%=note.getContent()%>" class="form-control col-4"/><br>


        <button type="submit" class="btn btn-primary col-4">修改</button>
    </form>
</div>
</body>
</html>
